import request from '@/utils/request';

/**
 * 获取功能树形列表
 *
 * @param queryParams
 */
export function listFuns(queryParams) {
  return request({
    url: '/sys/fun/listTree',
    method: 'get',
    params: queryParams,
  });
}

/**
 * 获取功能表单数据
 *
 * @param id
 */
export function findFunById(id) {
  return request({
    url: '/sys/fun/findById',
    method: 'get',
    params: {
      id: id,
    },
  });
}

/**
 * 修改
 *
 * @param data
 */
export function saveFun(data) {
  return request({
    url: '/sys/fun/save',
    method: 'post',
    data: data,
  });
}

/**
 * 删除功能
 *
 * @param id 功能ID
 */
export function deleteFun(id) {
  return request({
    url: '/sys/fun/delete',
    method: 'get',
    params: {
      ids: id,
    },
  });
}
